Я очень новичок в CSS, но пытаюсь отформатировать выравнивание в таблице HTML, которая содержит (3) столбцы (каждый столбец с заголовком). Я хочу, чтобы первый столбец выровнен в центре, 2-й левый и третий справа.
Я очень новичок в CSS, но пытаюсь отформатировать выравнивание в таблице HTML, которая содержит (3) столбцы (каждый столбец с заголовком). Я хочу, чтобы первый столбец выровнен в центре, 2-й левый и третий справа.[code]Table { font-family: Arial, Helvetica, sans-serif; background-color: #eeeeee; border-collapse: collapse; width: 100%; } Table td, table th { font-size: 10px; border: 1px solid #ddd; padding: 3px 3px; } Table th { font-weight: bold; padding-top: 6px; padding-bottom: 6px; background-color: #00b0f0; color: white; } /* first tr and then first th (Column 1)*/ table tr: first-child th: first-child{ text-align: center; } /* all cells under the first column */ table tr td: first-child { text-align: center; } /* first element of the second column (Column 2) */ table tr: first-child th: nth-child(2) { text-align: left; } /* all cells under the second column */ table tr td: nth-child(2) { text-align: left; } /* first element of the third column (Column 3) */ table tr: first-child th: nth-child(3) { text-align: right; } /* all cells under the third column */ table tr td: nth-child(3) { text-align: right; } [/code] Любая помощь будет оценена.