parvez / network_scanner

This Home Assistant integration provides a network scanner that identifies all devices on your local network. Utilizing the provided IP range and MAC address mappings, it gives each identified device a user-friendly name and manufacturer information.
MIT License
108 stars 4 forks source link

Column width #5

Closed geotibi closed 3 weeks ago

geotibi commented 8 months ago

Hello,

Is it any option to set the column width in the table? Right now I have 5 columns qhich are having same width even if some of them are having less chars.

parvez commented 3 weeks ago

you would need to look into https://github.com/custom-cards/flex-table-card for any further customizations.

dxmnkd316 commented 2 weeks ago

You can also try just using straight up html tables in the markdown card like this:

## Devices
<table border="1" width="800"><tr><th>IP Address</th>
<th style="width:70%">Custom Name</th>
<th>Custom Description</th>
<th>Hostname</th>
<th>Vendor</th></tr>
{% for device in state_attr('sensor.network_scanner', 'devices') %} <tr>
  <td>{{ device.ip }}</td>
  <td>{{ device.name }}</td>
  <td>{{ device.type }}</td>
  <td>{{ device.hostname }}</td>
  <td>{{ device.vendor }}</td>
  </tr>
{% endfor %}
</tr></table>

If your dashboard is configured for sections, make sure you have the proper width set in the layout tab for the card.