이 번역은 완료되지 않았습니다. 이 문서를 번역해 주세요.

HTML <table> 요소 2차원 이상의 데이터를 나타냅니다..

Content categories Flow content
Permitted content
In this order:
  1. an optional <caption> element,
  2. zero or more <colgroup> elements,
  3. an optional <thead> element,
  4. either one of the following:
    • zero or more <tbody> elements
    • one or more <tr> elements
  5. an optional <tfoot> element
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts flow content
Permitted ARIA roles Any
DOM interface HTMLTableElement

속성

이 요소는 전역 속성을 포함합니다.
이 페이지에 나열된 나머지 속성들은 deprecated 되었습니다.

align
 This enumerated attribute indicates how the table must be aligned in regard of the containing document. It may have the following values:
  • left, meaning that the table is to be displayed to the left of the document;
  • center, meaning that the table is to be displayed centered in the document;
  • right, meaning that the table is to be displayed to the right of the document.
참고:
  • Do not use this attribute, as it has been deprecated and the <table> element should be styled using CSS. To give an effect similar to the align attribute, the CSS layout should be used, like margin-left and margin-right set to auto ( or margin to 0 auto) to center it.
  • Prior to Firefox 4, Firefox also supported, in quirks mode only, the values middle, absmiddle, and abscenter as synonyms of center
bgcolor
This attribute defines the background color of the table and its content. It is one of the 6-digit hexadecimal code as defined in sRGB, prefixed by a '#'. One of the sixteen predefined color strings may be used:
  black = "#000000"   green = "#008000"
  silver = "#C0C0C0"   lime = "#00FF00"
  gray = "#808080"   olive = "#808000"
  white = "#FFFFFF"   yellow = "#FFFF00"
  maroon = "#800000"   navy = "#000080"
  red = "#FF0000"   blue = "#0000FF"
  purple = "#800080"   teal = "#008080"
  fuchsia = "#FF00FF"   aqua = "#00FFFF"
Usage 참고: Do not use this attribute, as it has been deprecated and the <table> element should be styled using CSS. To give an effect similar to the bgcolor attribute, the CSS property background-color should be used.
border
This integer attribute defines, in pixels, the size of the frame surrounding the table. If set to 0, it implies that the frame attribute is set to void.
Usage 참고: Do not use this attribute, as it has been deprecated and the <table> element should be styled using CSS. To give an effect similar to the border attribute, the CSS properties border, border-color, border-width and border-style should be used.
cellpadding
This attribute defines the space between the content of a cell and the border, displayed or not, of it. If it is a pixel length, this pixel-sized space will be applied on all four sides; if it is a percentage length, the content will be centered and the total vertical space (top and bottom) will represent this percentage. The same is true for the total horizontal space (left and right).
Usage 참고: Do not use this attribute, as it has been deprecated and the <table> element should be styled using CSS. To give an effect similar to the border attribute, use the CSS property border-collapse with the value collapse on the  <table> element itself, and the property padding on the <td>.
cellspacing
This attribute defines the size, in percentage or in pixels, of the space between two cells (both horizontally and vertically), between the top of the table and the cells of the first row, the left of the table and the first column, the right of the table and the last column and the bottom of the table and the last row.
Usage 참고: Do not use this attribute, as it has been deprecated and the <table> element should be styled using CSS. To give an effect similar to the cellspacing attribute, use the CSS property border-spacing on the <table> element itself.
frame
This enumerated attribute defines which side of the frame surrounding the table must be displayed. It may have the following values:
  above   below
  hsides   vsides
  lhs   rhs
  border   box
  void
Usage 참고: Do not use this attribute, as it has been deprecated and the <table> element should be styled using CSS. To give an effect similar to the frame attribute, use the CSS properties border-style and border-width.
rules
This enumerated attribute defines where rules, i.e. lines, should appear in a table. It can have the following values:
  • none, which indicates the no rules will be displayed; it is the default value;
  • groups, which will make the rules to be displayed between row groups (defined by the <thead>, <tbody> and <tfoot> elements) and between column groups (defined by the <col> and <colgroup> elements) only;
  • rows, which will make the rules to be displayed between rows;
  • columns, which will make the rules to be displayed between columns;
  • all, which wil make the rules to be displayed between rows and columns.
참고:
  • The styling of the rules is browser-dependant and cannot be modified.
  • Do not use this attribute, as it has been deprecated and the rules should be defined and styled using CSS. Use the CSS property border on the adequate <thead>, <tbody>, <tfoot>, <col> or <colgroup> elements.
summary
This attribute defines an alternative text use to describe the table in user-agent unable to display it. Typically, it contents a description of it to allow visually impaired people, like blind people browsing the web using Braille screen, to get the information in it. If the information added in this attribute may also be useful for non-visually impaired people, consider using the <caption> instead. The summary attribute is not mandatory and may be omitted when a <caption> element fulfills its role.
Usage 참고: Do not use this attribute, as it has been deprecated. Instead, use one of these way of describing a table:
  • In prose, surrounding the table (this is the less semantic-conveying way of doing it).
  • In the table's <caption> element.
  • In a <details> element, inside the table's <caption> element.
  • Include the <table> element in a <figure> element and add the description in prose next to it.
  • Include the <table> element in a <figure> element and add the description in prose inside a <figcaption> element.
  • Adjust the table so that such description is no more needed, by using <th> and <thead> elements for example.
width
This attribute defines the width of the table. It may either be a pixel length or a percentage value, representing the percentage of the width of its container that the table should use.
Usage Note: Do not use this attribute, as it has been deprecated and the rules should be defined and styled using CSS. Use the CSS property width instead.

예제

간단한 표

<table>
  <tr>
    <td>John</td>
    <td>Doe</td>
  </tr>
  <tr>
    <td>Jane</td>
    <td>Doe</td>
  </tr>
</table>

추가 예제

<p>Simple table with header</p>
<table>
  <tr>
    <th>First name</th>
    <th>Last name</th>
  </tr>
  <tr>
    <td>John</td>
    <td>Doe</td>
  </tr>
  <tr>
    <td>Jane</td>
    <td>Doe</td>
  </tr>
</table>

<p>Table with thead, tfoot, and tbody</p>
<table>
  <thead>
    <tr>
      <th>Header content 1</th>
      <th>Header content 2</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td>Footer content 1</td>
      <td>Footer content 2</td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>Body content 1</td>
      <td>Body content 2</td>
    </tr>
  </tbody>
</table>

<p>Table with colgroup</p>
<table>
  <colgroup span="4" class="columns"></colgroup>
  <tr>
    <th>Countries</th>
    <th>Capitals</th>
    <th>Population</th>
    <th>Language</th>
  </tr>
  <tr>
    <td>USA</td>
    <td>Washington D.C.</td>
    <td>309 million</td>
    <td>English</td>
  </tr>
  <tr>
    <td>Sweden</td>
    <td>Stockholm</td>
    <td>9 million</td>
    <td>Swedish</td>
  </tr>
</table>

<p>Table with colgroup and col</p>
<table>
  <colgroup>
    <col class="column1">
    <col class="columns2plus3" span="2">
  </colgroup>
  <tr>
    <th>Lime</th>
    <th>Lemon</th>
    <th>Orange</th>
  </tr>
  <tr>
    <td>Green</td>
    <td>Yellow</td>
    <td>Orange</td>
  </tr>
</table>

<p>Simple table with caption</p>
<table>
  <caption>Awesome caption</caption>
  <tr>
    <td>Awesome data</td>
  </tr>
</table>

명세

Specification Status Comment
HTML Living Standard
The definition of 'table element' in that specification.
Living Standard  
HTML5
The definition of 'table element' in that specification.
Recommendation  

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
tableChrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
align
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
bgcolor
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
border
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
cellpadding
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
cellspacing
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
frame
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
rules
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
summary
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
width
Deprecated
Chrome Full support 1Edge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Edge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

같이 보기

문서 태그 및 공헌자

이 페이지의 공헌자: alattalatta, mdnwebdocs-bot, azunyan3
최종 변경자: alattalatta,