Jump to content
  • 0

Как сделать выровнять текст по центру только в верхней строке(а именно в ее столбцах) ?


Frank
 Share

Question

Добрый день. Код:

<table id="a_table" border="1" bordercolor="#e1e1e1">
<tr class="a_table_tr_header"><td>a</td><td>b</td><td>c</td><td>d</td><td>e</td><td>f</td><td>g</td></tr>
<tr class="a_table_tr_main"><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="a_table_tr_main"><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="a_table_tr_main"><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="a_table_tr_main"><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="a_table_tr_main"><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr class="a_table_tr_main"><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
</table>

прописал #a_table tr.a_table_tr_header td{text-align:center}, но не помогает...

Как правильно в css прописать чтобы верхняя строка таблицы выделилась цветом #e1e1e1 ?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Я уточню. Нужно выровнять текст в шапке таблицы по центру? Тогда <td> напишите <th> (текст выровняется по центру и станет полужирным). Или нужно часть текста в ячейке выровнять по центру?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy