2017-03-07 78 views
1

我找到了一個與行跨度一起工作的示例,並在引導表中固定了前幾列。 我試圖將其修改爲列跨度,但它不起作用。有誰知道如何使用列間距和固定列 在引導表中。謝謝。具有固定列和列跨度的自舉表

下面是示例: Jsfiddle row span and fixed columns

<table data-toggle="table" data-fixed-columns="true" data-fixed-number="3"> 
<thead> 
<tr> 
    <th>Title</th> 
    <th colspan='2'>1</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> 
    <th>14</th> 
    <th>15</th> 
    <th>16</th> 
    <th>16</th> 
    <th>17</th> 
    <th>18</th> 
    <th>19</th> 
    <th>20</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
    <td rowspan="3">Momentum</td> 
    <td>1</td> 
    <td>2</td> 
    <td>3</td> 
    <td>4</td> 
    <td>5</td> 
    <td>6</td> 
    <td>7</td> 
    <td>8</td> 
    <td>9</td> 
    <td>10</td> 
    <td>11</td> 
    <td>12</td> 
    <td>13</td> 
    <td>14</td> 
    <td>15</td> 
    <td>16</td> 
    <td>16</td> 
    <td>17</td> 
    <td>18</td> 
    <td>19</td> 
    <td>20</td> 
</tr> 
<tr> 
    <td>1</td> 
    <td>2</td> 
    <td>3</td> 
    <td>4</td> 
    <td>5</td> 
    <td>6</td> 
    <td>7</td> 
    <td>8</td> 
    <td>9</td> 
    <td>10</td> 
    <td>11</td> 
    <td>12</td> 
    <td>13</td> 
    <td>14</td> 
    <td>15</td> 
    <td>16</td> 
    <td>16</td> 
    <td>17</td> 
    <td>18</td> 
    <td>19</td> 
    <td>20</td> 
</tr> 
<tr> 
    <td>1</td> 
    <td>2</td> 
    <td>3</td> 
    <td>4</td> 
    <td>5</td> 
    <td>6</td> 
    <td>7</td> 
    <td>8</td> 
    <td>9</td> 
    <td>10</td> 
    <td>11</td> 
    <td>12</td> 
    <td>13</td> 
    <td>14</td> 
    <td>15</td> 
    <td>16</td> 
    <td>16</td> 
    <td>17</td> 
    <td>18</td> 
    <td>19</td> 
    <td>20</td> 
</tr> 
<tr> 
    <td>0</td> 
    <td>1</td> 
    <td>2</td> 
    <td>3</td> 
    <td>4</td> 
    <td>5</td> 
    <td>6</td> 
    <td>7</td> 
    <td>8</td> 
    <td>9</td> 
    <td>10</td> 
    <td>11</td> 
    <td>12</td> 
    <td>13</td> 
    <td>14</td> 
    <td>15</td> 
    <td>16</td> 
    <td>16</td> 
    <td>17</td> 
    <td>18</td> 
    <td>19</td> 
    <td>20</td> 
</tr> 
<tr> 
    <td rowspan="2">Best EPS</td> 
    <td>1</td> 
    <td>2</td> 
    <td>3</td> 
    <td>4</td> 
    <td>5</td> 
    <td>6</td> 
    <td>7</td> 
    <td>8</td> 
    <td>9</td> 
    <td>10</td> 
    <td>11</td> 
    <td>12</td> 
    <td>13</td> 
    <td>14</td> 
    <td>15</td> 
    <td>16</td> 
    <td>16</td> 
    <td>17</td> 
    <td>18</td> 
    <td>19</td> 
    <td>20</td> 
</tr> 
<tr> 
    <td>1</td> 
    <td>2</td> 
    <td>3</td> 
    <td>4</td> 
    <td>5</td> 
    <td>6</td> 
    <td>7</td> 
    <td>8</td> 
    <td>9</td> 
    <td>10</td> 
    <td>11</td> 
    <td>12</td> 
    <td>13</td> 
    <td>14</td> 
    <td>15</td> 
    <td>16</td> 
    <td>16</td> 
    <td>17</td> 
    <td>18</td> 
    <td>19</td> 
    <td>20</td> 
</tr> 

+0

你究竟想達到什麼目的。你想重新創建樣本小提琴嗎? –

+0

@ H.Brendan我嘗試修改樣本以支持固定列的列間距。如果你可以提供一些樣品也可以。 – nettium

+0

我試了一下,把TD放在小提琴上試試看,我不知道這是不是你想要的, –

回答

0

我認爲你想做的事是這樣的。

<td rowspan="3">Momentum</td> 
<td>1</td> 
<td>2</td> 
<td colspan="2">3</td> 
<td>4</td> 
<td>5</td> 
<td>6</td> 
<td>7</td> 
<td>8</td> 
<td>9</td> 
<td>10</td> 
<td>11</td> 
<td>12</td> 
<td>13</td> 
<td>14</td> 
<td>15</td> 
<td>16</td> 
<td>16</td> 
<td>17</td> 
<td>18</td> 
<td>19</td> 
<td>20</td> Delete this one. 

這隻會返回類似al框的東西,只有一個就是2寬度。

+0

我想在滾動第一列的時候修復。 – nettium

+0

職位:固定;然後將此添加到第一列 –