CSS для таблицы не применяется правильно? - PullRequest
0 голосов
/ 21 июня 2011

http://jsfiddle.net/RpCTx/4/

Столбцы таблицы не меняются до указанной мной ширины. Второй столбец - способ сузить ...

CSS:

body{
    font-size: 11px;
    font-family: Calibri, Arial, Helvetica;
}
th {
     border-bottom: 1px solid black;   
}
.product_name, td {
    width: 132px;
}
.description, td + td {
    width: 290;
}
.quantity, td + td + td {
    width: 30px;
}
.list_upfronts, td + td + td + td {
    width: 77px;
}
.sales_price, td + td + td + td + td{
    width: 76px;
}

HTML:

<strong>
    <u>
        Starcraft, or something
    </u>
</strong>

<table id="integration_and_data_services">
    <tr>
        <th class="product_name">
            <b>Product Name</b>
        </th>
        <th class="description">
            <b>Description Information</b>
        </th>
        <th class="quantity">
            <b>QTY</b>
        </th>
        <th class="list_upfronts">
            <b>Upfronts</b>
       </th>
        <th class="sales_price">
            <b>Sales Price</b>
        </th>
    </tr>
    <tr>
        <td>Le Product name</td>
        <td>Lots of text here about whatever the product is about. Just needs to wrap to multiple lines.... Probably should be about starcraft... whatever.</td>
        <td>1.00</td>
        <td>$4500.00</td>
        <td>$4500.00</td>
    </tr>
</table>

Ответы [ 3 ]

3 голосов
/ 21 июня 2011

Вы пропустили px в объявлении width для 2-го столбца:

.description, td + td {
    width: 290px;
}

Демо

2 голосов
/ 21 июня 2011

Просто имейте адрес ширины каждого th

Они вам не нужны в tds.удалить тд + ...

вот так, http://jsfiddle.net/RpCTx/8/

0 голосов
/ 21 июня 2011

В правиле есть ошибка: вам не хватает «px»

Это правильно:

.description, td + td {
    width: 290px;
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...