001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.dto.html5; 014 015import org.apache.juneau.annotation.*; 016 017/** 018 * DTO for an HTML {@doc ExtHTML5.tabular-data#the-td-element <td>} 019 * element. 020 * 021 * <ul class='seealso'> 022 * <li class='link'>{@doc DtoHtml5} 023 * </ul> 024 */ 025@Bean(typeName="td") 026public class Td extends HtmlElementMixed { 027 028 /** 029 * Creates an empty {@link Td} element. 030 */ 031 public Td() {} 032 033 /** 034 * Creates a {@link Td} element with the specified child nodes. 035 * 036 * @param children The child nodes. 037 */ 038 public Td(Object...children) { 039 children(children); 040 } 041 042 /** 043 * {@doc ExtHTML5.tabular-data#attr-tdth-colspan colspan} attribute. 044 * 045 * <p> 046 * Number of columns that the cell is to span. 047 * 048 * @param colspan 049 * The new value for this attribute. 050 * Typically a {@link Number} or {@link String}. 051 * @return This object (for method chaining). 052 */ 053 public final Td colspan(Object colspan) { 054 attr("colspan", colspan); 055 return this; 056 } 057 058 /** 059 * {@doc ExtHTML5.tabular-data#attr-tdth-headers headers} attribute. 060 * 061 * <p> 062 * The header cells for this cell. 063 * 064 * @param headers The new value for this attribute. 065 * @return This object (for method chaining). 066 */ 067 public final Td headers(String headers) { 068 attr("headers", headers); 069 return this; 070 } 071 072 /** 073 * {@doc ExtHTML5.tabular-data#attr-tdth-rowspan rowspan} attribute. 074 * 075 * <p> 076 * Number of rows that the cell is to span. 077 * 078 * @param rowspan 079 * The new value for this attribute. 080 * Typically a {@link Number} or {@link String}. 081 * @return This object (for method chaining). 082 */ 083 public final Td rowspan(Object rowspan) { 084 attr("rowspan", rowspan); 085 return this; 086 } 087 088 089 //----------------------------------------------------------------------------------------------------------------- 090 // Overridden methods 091 //----------------------------------------------------------------------------------------------------------------- 092 093 @Override /* HtmlElement */ 094 public final Td _class(String _class) { 095 super._class(_class); 096 return this; 097 } 098 099 @Override /* HtmlElement */ 100 public final Td id(String id) { 101 super.id(id); 102 return this; 103 } 104 105 @Override /* HtmlElement */ 106 public final Td style(String style) { 107 super.style(style); 108 return this; 109 } 110 111 @Override /* HtmlElementMixed */ 112 public Td children(Object...children) { 113 super.children(children); 114 return this; 115 } 116 117 @Override /* HtmlElementMixed */ 118 public Td child(Object child) { 119 super.child(child); 120 return this; 121 } 122}