答案 0 :(得分:2)
<Style TargetType="{x:Type TextBox}">
<Setter Property="Template">
<Setter.Value>
<!-- Modify default template, to change triggers -->
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
尝试搜索<table border=1>
<tr>
<th>NAME</th>
<th>AGE</th>
<th colspan="3">ACTIONS</th>
</tr>
<tr>
<td>Salman Mushtaq</td>
<td>27</td>
<td><a href="#">Detail</a></td>
<td><a href="#">Update</a></td>
<td><a href="#">Delete</a></td>
</tr>
<tr>
<td>Muhanmmad Awais</td>
<td>32</td>
<td><a href="#">Detail</a></td>
<td><a href="#">Update</a></td>
<td><a href="#">Delete</a></td>
</tr>
</tr>
<tr>
<td>Imran Hassan</td>
<td>38</td>
<td><a href="#">Detail</a></td>
<td><a href="#">Update</a></td>
<td><a href="#">Delete</a></td>
</tr>
</tr>
<tr>
<td>Muhammad Asad</td>
<td>33</td>
<td><a href="#">Detail</a></td>
<td><a href="#">Update</a></td>
<td><a href="#">Delete</a></td>
</tr>
</table>
和colspan
答案 1 :(得分:1)
在colspan
标记中使用TH
属性(即。colspan="3"
)
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th colspan="3">Action (spanned 3 cols)</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>action 1</td>
<td>Action 2</td>
<td>Action 3</td>
</tr>
</tbody>
</table>