2016-09-21 87 views
0

我想要一張6桌並排,但是當他們到達他們的最後時,他們在下一行被排序。並排的桌子上有溢出

我試過float,但是當顯示寬度達到時,元素仍然在下一行開始。

歡迎任何提示。

這是我的代碼:我拿走了所有樣式格式,因爲我無法將它們排成一行。

Link: http://jsfiddle.net/S3n6D/101/ 
+2

您可以發佈您的代碼? – Dsenese1

+0

是的,我只是拿走了風格,因爲我真的搞砸了...你能給我提示嗎? – Moonstar

+0

您應該使用代碼片段將實際代碼粘貼到問題中,而不是鏈接。 –

回答

0

我想你可以使用這個css;

table { 
    width:15%; 
    float:left; 
} 

如果你想要更寬的表格,你也可以改變身體的寬度;

body { 
    width:1800px; 
} 

table { 
    width:300px; /* or 15% if you want it more dynamic */ 
    margin:0; 
    float:left; 
} 
+0

當行結束時,元素被設置在一個新的行上...我只想排列它們並使其滾動... – Moonstar

0

經過一番清潔與秩序到您的代碼,請嘗試:

div { 
 
    float: left; 
 
}
<table border="1"> 
 
    <thead> 
 
    <tr> 
 
     <th rowspan="1">&nbsp;</th> 
 
    </tr> 
 
    <tr> 
 
     <th>Filiale</th> 
 
    </tr> 
 
    </thead> 
 
</table> 
 
<br> 
 
<div> 
 
    <table border="1"> 
 
    <!-- MO --> 
 
    <thead> 
 
     <tr> 
 
     <th colspan="14">19.09.2016</th> 
 
     </tr> 
 
     <tr> 
 
     <th>1</th> 
 
     <th>2</th> 
 
     <th>3</th> 
 
     <th>4</th> 
 
     <th>5</th> 
 
     <th>6</th> 
 
     <th>7</th> 
 
     <th>8</th> 
 
     <th>9</th> 
 
     <th>10</th> 
 
     <th>11</th> 
 
     <th>12</th> 
 
     <th>13</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 

 
    </tbody> 
 
    </table> 
 
</div> 
 

 

 
<div> 
 
    <table border="1"> 
 
    <!-- DI --> 
 
    <thead> 
 
     <tr> 
 
     <th colspan="13">20.09.2016</th> 
 
     </tr> 
 
     <tr> 
 
     <th>1</th> 
 
     <th>2</th> 
 
     <th>3</th> 
 
     <th>4</th> 
 
     <th>5</th> 
 
     <th>6</th> 
 
     <th>7</th> 
 
     <th>8</th> 
 
     <th>9</th> 
 
     <th>10</th> 
 
     <th>11</th> 
 
     <th>12</th> 
 
     <th>13</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 

 
    </tbody> 
 
    </table> 
 
</div> 
 

 
<div> 
 
    <table border="1"> 
 
    <!-- MI --> 
 
    <thead> 
 
     <tr> 
 
     <th colspan="13">21.09.2016</th> 
 
     </tr> 
 
     <tr> 
 
     <th>1</th> 
 
     <th>2</th> 
 
     <th>3</th> 
 
     <th>4</th> 
 
     <th>5</th> 
 
     <th>6</th> 
 
     <th>7</th> 
 
     <th>8</th> 
 
     <th>9</th> 
 
     <th>10</th> 
 
     <th>11</th> 
 
     <th>12</th> 
 
     <th>13</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 

 
    </tbody> 
 
    </table> 
 
</div> 
 
<div> 
 
    <table border="1"> 
 
    <!-- DO --> 
 
    <thead> 
 
     <tr> 
 
     <th colspan="13">22.09.2016</th> 
 
     </tr> 
 
     <tr> 
 
     <th>1</th> 
 
     <th>2</th> 
 
     <th>3</th> 
 
     <th>4</th> 
 
     <th>5</th> 
 
     <th>6</th> 
 
     <th>7</th> 
 
     <th>8</th> 
 
     <th>9</th> 
 
     <th>10</th> 
 
     <th>11</th> 
 
     <th>12</th> 
 
     <th>13</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 

 
    </tbody> 
 
    </table> 
 
</div> 
 
<div> 
 
    <table border="1"> 
 
    <!-- FR --> 
 
    <thead> 
 
     <tr> 
 
     <th colspan="13">23.09.2016</th> 
 
     </tr> 
 
     <tr> 
 
     <th>1</th> 
 
     <th>2</th> 
 
     <th>3</th> 
 
     <th>4</th> 
 
     <th>5</th> 
 
     <th>6</th> 
 
     <th>7</th> 
 
     <th>8</th> 
 
     <th>9</th> 
 
     <th>10</th> 
 
     <th>11</th> 
 
     <th>12</th> 
 
     <th>13</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 

 
    </tbody> 
 
    </table> 
 
</div> 
 
<div> 
 
    <table border="1"> 
 
    <!-- SA --> 
 
    <thead> 
 
     <tr> 
 
     <th rowspan="1">&nbsp;</th> 
 
     <th colspan="13">24.09.2016</th> 
 

 
     </tr> 
 
     <tr> 
 
     <th>1</th> 
 
     <th>2</th> 
 
     <th>3</th> 
 
     <th>4</th> 
 
     <th>5</th> 
 
     <th>6</th> 
 
     <th>7</th> 
 
     <th>8</th> 
 
     <th>9</th> 
 
     <th>10</th> 
 
     <th>11</th> 
 
     <th>12</th> 
 
     <th>13</th> 
 
     </tr> 
 
    </thead> 
 
    <tbody> 
 
    </tbody> 
 
    </table> 
 
</div>

+0

謝謝。但我想排隊他們,沒有換行符...溢出應滾動...我是一個非常初學者,並嘗試過這麼多... – Moonstar

+0

我會很快發送圖片... – Moonstar